import 'package:flutter/material.dart';
import 'package:mi_mang_flutter/utils/image_utils.dart';

/// 暂无数据组件
class WidgetNoData extends StatelessWidget {
  const WidgetNoData({Key? key, this.hintText = "暂时没有相关数据哦！"}) : super(key: key);

  /// 提示文字
  final String hintText;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //创建透明层
      resizeToAvoidBottomInset: false,
      backgroundColor: Colors.transparent,
      body: Container(
        height: double.infinity,
        width: double.infinity,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Expanded(
              child: SizedBox(),
              flex: 2,
            ),
            SizedBox(
              width: 189.0,
              height: 170.0,
              child: loadImage('public/no_data'),
            ),
            Text(
              hintText,
              style: TextStyle(fontSize: 12.0, color: Colors.grey[600]),
            ),
            Expanded(
              child: SizedBox(),
              flex: 3,
            ),
          ],
        ),
      ),
    );
  }
}
